home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PsL Monthly 1993 December
/
PSL Monthly Shareware CD-ROM (December 1993).iso
/
prgmming
/
dos
/
basic
/
vbhelp.exe
/
HELPDEMO.TXT
< prev
next >
Wrap
Text File
|
1992-08-19
|
18KB
|
508 lines
.TOPIC:
Contents
The Visual Basic for MS-DOS Help Toolkit makes it easy to add
hypertext Help to your applications. The text you are reading
now is a Helpfile. The Help Toolkit is written entirely in
Visual Basic and can be modified. Help files are standard ASCII
files that can be edited with most text editors and even by
Visual Basic itself.
Click the mouse over one of the topics below for more
information. Or press TAB to select a topic then press ENTER
to jump to it.
Creating and Editing Help files
Adding Help to Your Applications
Using Help
Customizing the Help Toolkit
.TOPIC:
Creating and Editing Help Files
To create a new Help file:
1. Determine which topics a user might want Help with.
2. Start any text editor that reads and writes ASCII files.
3. Create a topic named Contents and type a table of
contents below. See Creating and Editing Topics.
Note that the Contents command button will not work
correctly unless you include a topic named Contents.
4. Every entry in the table of contents should be a link
to a Help topic. See Creating Links
5. Create a Help topic for every link in the table of
contents. See Creating and Editing Topics
6. Every Help topic can contain links to other Help topics.
7. Help topics do not need to be listed in the table of
contents.
To edit an existing Help file:
NOTE: The Help Toolkit cannot access Microsoft .HLP files.
1. Open the Help file in a text editor that reads and writes
ASCII files.
2. Modify Links and Topics as described above.
See Example Help File
.TOPIC:
Creating and Editing Topics
The Help Toolkit distinguishes Help topics from ordinary
text by requiring that all topics are formatted in a
specific way.
1. The word TOPIC must be on a line by itself, preceeded
by a period (.) and followed by a colon (:). TOPIC
must be in uppercase.
2. The period must be the first character on the line.
3. Only spaces are allowed after the colon.
4. The name of the topic itself must be on the line
immediately below the .TOPIC: statement.
5. The topic text should begin on the line after the
name of the topic.
6. The Help Toolkit will not word wrap text. Use the
ENTER key to break text into reasonable length lines.
64 character lines work well because the Help window
defaults to 66 characters wide.
7. The next topic should begin immediately after the last
line of the current topic.
For example, the following would be a valid topic except
that the period is the second character on the line not the
first.
.TOPIC:
This is a help topic name
This is the first line a Help topic.
.
.
.
.
This is the last line of a Help topic.
See Creating Links Example Help File
.TOPIC:
Creating Links
Links are hot spots that a Help user clicks on to jump
to a Help topic. Links are ordinary text surrounded by
special triangle characters (ASCII codes 16 and 17).
Links and Topics must have exactly the same name or the
Help Toolkit will not be able to find a Topic when a Link
is clicked.
For example, click on Valid Help Topic to see how Links
jump to new Topics. And click on Invalid Help Topic to
see what happens if you create a Link without a matching
Topic.
See Creating and Editing Topics
.TOPIC:
Adding Help to Your Applications
Necessary Files
---------------
You must add the following files to your project to use
the Help Toolkit:
1. HELP.BAS
2. HELPF.FRM
3. HELPUTIL.FRM
All files that call Help Toolkit routines must also have
the following statement at the module level:
'$INCLUDE: 'HELP.BI'
Calling Help Toolkit Routines
-----------------------------
Required Steps:
1. Initialize the Help system by calling the
HelpRegister <HelpFileName$> procedure. You should do this
when your application starts.
2. Display Help topics or the table of contents by
calling HelpShowTopic <HelpTopicName$>. HelpTopicName$
should be "Contents" to show the table of contents.
3. Call HelpClose just before your application ends.
NOTE: You must call HelpClose during a Form_Unload
event if your application ends when the last form is
closed rather than by executing an END statement.
Your application will not end if you fail to do this
because frmHelpMain is still LOADED although invisible.
Optional:
1. Call HelpSetOptions to set Help colors and show/hide
specific Help command buttons after you call HelpRegister.
See Help Toolkit Procedures for details.
2. Call HelpSearch to open Help's Search dialog. Many
applications have a Search item under their Help menu.
See Example Help Toolkit Application and
Help Toolkit Procedures for detailed information.
.TOPIC:
Valid Help Topic
You jumped to this topic by clicking the Valid Help Topic
link.
Click ---> Creating Links or choose the Back command button
to return.
.TOPIC:
Customizing the Help Toolkit
You can add or remove functionality from the Help Toolkit
by changing the code in the following files:
1. HELP.BAS
2. HELPF.FRM
3. HELPUTIL.FRM
HELP.BAS contains all the application callable procedures
such as HelpShowTopic and HelpRegister.
HELPF.FRM is the main Help form. It contains the code
required to display and scroll through Help topics. It
also has the code used to detect mouse clicks (to jump Links)
and keyboard support.
HELPUTIL.FRM is a form that serves as the Search dialog, the
History dialog, and the Copy dialog. It is called from
HELPF.FRM and HELP.BAS. The look of the form is controlled
entirely from the cmdButtonBar_Click routine in HELPF.FRM and
the HelpSearch routine in HELP.BAS.
HELPF.FRM and HELP.BAS use the HELP.BI INCLUDE file.
See Adding Help to Your Applications
.TOPIC:
Example Help File
The following is an example of a small Help file. Note that
real Help files must be flush left. This example is indented
one character to stop the Help Toolkit from processing .TOPIC:
statements. A real Help file would also have ASCII 16 and 17
characters in place of the > and < symbols used below.
.TOPIC:
Contents
Welcome to Bob's Accounting System version 7.1
<Introduction>
<Adding New Accounts>
<Ordering Additional Modules>
.TOPIC:
Introduction
Bob's Accounting System is specificially designed for small
business accounting. It includes modules for <Accounts Payable>
and <Accounts Receivable>. Other modules may be purchased
seperately. See <Ordering Additional Modules>
.TOPIC:
Adding New Accounts
Choose New from the Accounts menu.
You can also press F8.
Note that Bob's Accounting System can store as many accounts
as disk space allows.
.TOPIC:
Accounts Payable
Access the A/P module through the Payables menu.
Note that A/P entries are automatially added to the general
ledger when you exit Bob's Accounting System.
See <Accounts Receivable>
.TOPIC:
Accounts Receivable
Access the A/P module through the Receievables menu.
Note that A/R entries are automatially added to the general
ledger when you exit Bob's Accounting System.
See <Accounts Payable>
.TOPIC:
Ordering Additional Modules
You can call (123) 555-5555 between 9 am and 5 pm to
inquire about new modules. New modules such as tax, benefits,
and inventory are scheduled to be ready later this year.
See Creating and Editing Help files
.TOPIC:
Example Help Toolkit Application
The following shows how the Help Toolkit procedures should be
added to an application. Assume the application is one form
with menu controls for Help|Contents, Help|Search, and
Help|Using Help. It also has a Text control named txtFileName
and a check box named ckReadOnly.
' Module-level
'$INCLUDE: 'HELP.BI'
DIM SHARED HelpLoaded%
SUB Form_Load ()
HelpRegister "MYHELP.TXT" , HelpLoaded%
' HelpLoaded% is set to TRUE (-1) if HelpRegister
' was successful or to FALSE (0) if it failed.
IF HelpLoaded% = FALSE THEN
' Ensure that Help menu choices cannot
' be selected.
mnuHelpContents.Enable